package mlz.g_big;

import java.math.BigInteger;

//BigInteger: 大整数类
public class BigIntegerDemo02 {
    public static void main(String[] args) {
        //创建大整数类对象
        BigInteger b1 = new BigInteger("123384566387621212");
        BigInteger b2 = new BigInteger("223384536387421212");

        //求和 b1 + b2
        BigInteger add = b1.add(b2);
        System.out.println(add);//346769102775042424

        //求差 b1 - b2
        System.out.println(b1.subtract(b2));//-99999969999800000

        //求积 b1 * b2
        System.out.println(b1.multiply(b2));//27562204159861758838364303749948944

        //求商 b1 / b2
        System.out.println(b1.divide(b2));//0
    }
}
